<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head><title>提升基本类型为对象</title></head>
<body>
	<h1>提升基本类型为对象</h1><hr>
	<script type="text/javascript">
		var myArr = new Array();
		for(var i=0; i<10; i++) {
			myArr[i] = i*i;
		}
	
		document.write("<br>myArr的类型为: " + typeof(myArr));
		document.write("<br>myArr的内容为: ");
		for(var i=0; i<myArr.length; i++) {
			document.write(myArr[i] + "&nbsp;");	
		}
		
		str1 = myArr.join();
		document.write("<br><br>str1的类型为: " + typeof(str1));
		document.write("<br>str1的内容为: " + str1);
		
		var len = str1.length;
		var link = str1.link("example01.com");
		var big = str1.big();
		var bold = str1.bold();
		var color = str1.fontcolor("red");
		document.write("<br><br>str1的长度为: " + len);
		document.write("<br>str1应用link()后: " + link);
		document.write("<br>str1应用big()后: " + big);
		document.write("<br>str1应用bold()后: " + bold);
		document.write("<br>str1应用color()后: " + color);
		
		var firstOne = str1.indexOf("1");
		var lastOne = str1.lastIndexOf("1");
		var theTenthChar = str1.charAt(9);
		document.write("<br><br>数字1出现在str1中第一次位置: " + firstOne);
		document.write("<br>数字1出现在str1中最后一次位置: " + lastOne);
		document.write("<br>str1中第10个字符为: " + theTenthChar);
		

	</script>
</body>
</html>
